import WebSocket from '@/utils/stomp/stomprabbitmq-stomprabbitmq.js';
export default {
	onLoad() {
		console.log('链接里饿吗')
		uni.$on('sendMessage', res => {
			console.log('接收到的消息：', res);
			this.test = JSON.parse(res.body);
		});

		this.rabbit();
		uni.$on('socketError', res => {
			console.log('失去连接res');
			setTimeout(() => {
				this.rabbit();
			}, 5000);
		});
	},
	methods: {
		rabbit() {
			let that = this;
			WebSocket.init(); // 可自行修改
		},
		send(message) {
			console.log('message person', message)
			WebSocket.send('person_device_upload', message);
		},
		send_testtwo(message) {
			console.log('send_doctor_message', message)
			WebSocket.send('doctor_device_upload', message);
		},
	}
}